package cc.comac.mom.service.impl.log;

import cc.comac.mom.bean.QualityMaterialData;
import cc.comac.mom.dao.entity.QualityMaterialDataDao;
import cc.comac.mom.dao.entity.log.LogInfoDao;
import cc.comac.mom.entity.QualityMaterialDataEntity;
import cc.comac.mom.entity.log.PortalInterfaceLogEntity;
import cc.comac.mom.util.BaseEntityDataUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;

@Component
//忽略当前事务
@Transactional(propagation = Propagation.NOT_SUPPORTED)
public class LogInfoServiceImpl  extends ServiceImpl<LogInfoDao, PortalInterfaceLogEntity> {
	@Autowired
	private LogInfoDao logInfoDao;

	private BaseEntityDataUtil baseEntityDataUtil;

	//保存日志
	public boolean insertLogInfo(PortalInterfaceLogEntity bean) {
		bean.setCreateTime(new Date());
		bean.setLastUpdateTime(new Date());
		logInfoDao.insert(bean);
		return true;
	}
	//修改日志
	public boolean updateLoginfo(PortalInterfaceLogEntity bean) {
		bean.setLastUpdateTime(new Date());
		logInfoDao.updateById(bean);
		return true;
	}
}
